﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Cosmetic.Logic;

public partial class Controls_ProductByCategoryOrderComments : System.Web.UI.UserControl
{
	private ProductManager m_ProductManager		= new ProductManager();

	private int m_ShowCount = 10;
	public int ShowCount
	{
		get { return m_ShowCount; }
		set { m_ShowCount = value; }
	}
	

	private Guid m_ProductCategoryId;
	public Guid ProductCategoryId 
	{ 
		get
		{
			return this.m_ProductCategoryId;
		}
		set
		{ 
			this.m_ProductCategoryId	= value;
			this.BindProduct(); 
		} 
	}

	protected void Page_Load(object sender, EventArgs e)
	{
		this.BindProduct();
	}

	private void BindProduct()
	{
		this.lvProductWeek.DataSource	= this.m_ProductManager.GetProductByCategoryOrderComments(ProductCategoryId, DateTime.Today.AddDays(-7), DateTime.Today, ShowCount);
		this.lvProductWeek.DataBind();

		this.lvProductMonth.DataSource	= this.m_ProductManager.GetProductByCategoryOrderComments(ProductCategoryId, DateTime.Today.AddDays(-30), DateTime.Today, ShowCount);
		this.lvProductMonth.DataBind();
	}
}
